import base from './base'

export default class News extends base {
    static async getPointsList(options) {
        const url = `${this.baseUrl}/adm/news/article/score/list`
        return this.get(url, options)
    }
    static async getNoPointsList(options) {
        const url = `${this.baseUrl}/adm/news/article/list`
        return this.get(url, options)
    }
    static async getPointsNewDetail(options) {
        const url = `${this.baseUrl}/adm/news/article/score/detail`
        return this.get(url, options)
    }
    static async getNoPointsNewDetail(options) {
        const url = `${this.baseUrl}/adm/news/article/detail`
        return this.get(url, options)
    }
    static async getCategory(options) {
        const url = `${this.baseUrl}/adm/news/article/category/list`
        return this.get(url, options)
    }
    static async getProject(options) {
        const url = `${this.baseUrl}/adm/sale_project/forSelect`
        return this.get(url, options)
    }
    static async saveArticle(options, urlType) {
        let url = "";
        if (urlType == 'add') {
            url = `${this.baseUrl}/adm/news/article/score/createarticle`
        }
        else if (urlType == 'againEdit') {
            url = `${this.baseUrl}/adm/news/article/score/editscorearticle`
        }
        return this.post(url, options)
    }
    static async changeArticleStatus(options) {
        const url = `${this.baseUrl}/adm/news/article/score/updatescorearticlestatus`
        return this.post(url, options)
    }
    static async changeBaseArticleStatus(options) {
        const url = `${this.baseUrl}/adm/news/article/source/update`
        return this.post(url, options)
    }
    static async getCategoryList(options) {
        const url = `${this.baseUrl}/adm/news/article/category/admlist`
        return this.get(url, options)
    }
    static async saveCategory(options,urlType) {
        let url = "";
        if(urlType == 'add'){
            url = `${this.baseUrl}/adm/news/article/category/add`
        }
        else if(urlType == 'againEdit'){
            url = `${this.baseUrl}/adm/news/article/category/edit`
        }
        return this.post(url, options)
    }
    static async getCategoryDetail(options) {
        const url = `${this.baseUrl}/adm/news/article/category/detail`
        return this.get(url, options)
    }
    static async getBaseNews(options) {
        const url = `${this.baseUrl}/adm/news/article/source/list`
        return this.get(url, options)
    }
    static async getBaseNewDetail(options) {
        const url = `${this.baseUrl}/adm/news/article/source/detail`
        return this.get(url, options)
    }
    static async deleteNewsCategory(options) {
        const url = `${this.baseUrl}/adm/news/article/category/delete`
        return this.post(url, options)
    }
}
